package GradeCalculation;

import java.util.List;

/**
 * @Author maojiangyue
 * @Date 2025/10/18
 * @Description 学科成绩计算-总分取平均数
 */
public class SubjectGrades implements GradeCount{
    @Override
    public double averageScore(List<Double> scores) {
        if(scores==null || scores.isEmpty()){
            return 0;
        }
        double total=0;
        for (Double score : scores) {
            total+=score;
        }
        return total/scores.size();
    }

    @Override
    public String getName() {
        return "学科成绩";
    }
}
